<%@ page import="java.util.List" %>
<%@ page import="com.nus.beans.ProjectRemark" %>
<%@ page import="org.apache.commons.lang3.StringEscapeUtils" %>
<html>
<head>
    <script type="text/javascript">
        function submitForm(action) {
            form = document.getElementById('projectRemarksForm');

            form.action = action;
            form.submit();
        }
    </script>
    <title>Project Remarks</title></head>
<%
    String errorMessage = (String) request.getAttribute("ERROR_MESSAGE");
%>
<body>
<P>Project Remarks</P>

<form method="post" id="projectRemarksForm">

    <select name="projectRemark" size="10">
        <%
            List<ProjectRemark> projectRemarkssList = (List<ProjectRemark>) request.getAttribute("projectRemarks");
            for (ProjectRemark projectRemark : projectRemarkssList) {
        %>

        <option value="<%=projectRemark.getId() %>"> <%= projectRemark.getEnteredBy().getLastName()%> -----> <%=StringEscapeUtils.escapeXml(projectRemark.getRemark())%>
        </option>
        <% } %>

    </select>
    <br/>
    <%
        if (errorMessage != null) {
    %>
    <%=errorMessage %>

    <% } %>
    <br/>
    <input type="button" value="Delete" onclick="submitForm('deleteProjectRemark.do')"/>
    <input type="button" value="Add / Update Remark" onclick="submitForm('ViewAddProjectRemark.do')"/>
    <a href="viewHome.do">Home</a>
</form>


</body>
</html>